<?php
namespace app\user\validate\teacher;

use think\Validate;

/**
 * 讲师素材分类验证
 */
class MaterialCategory extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'    =>    ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'type'      => 'require|integer|in:1,2,3,4',
        'title'     => 'require',
        'id'        => 'require|integer',
    ];

    protected $field = [
        'type'      => '素材类型',
        'title'     => '分组名称',
        'id'        => '分组ID',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'    =>    '错误信息'
     *
     * @var array
     */
    protected $message = [

    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'list'          => ['type'],
        'create'        => ['type', 'title'],
        'update'        => ['id', 'title'],
        'delete'        => ['id'],
    ];


}
